# sprite = codesters.Circle(x, y, diameter, "color")
sun = codesters.Circle(-150, 175, 75, "gold")
# sprite = codesters.Square(x, y, width, "color")
house = codesters.Square(0, -125, 250, "purple")
# sprite = codesters.Triangle(x, y, size, "color")
roof = codesters.Triangle(0, 0, 100, "blue")
try:
tval1 = roof.get_width()
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 300, "Great Job!")
t1.add_failure(tval1 == 100, "Did you change your roof's size?")
t1.add_failure(tval1 == "DNE", "Did you rename your triangle?")
t1.add_creative(tval1 > 300 and tval1 != 100, "That's a big roof!")
t1.add_creative(tval1 < 300 and tval1 != 100 , "That's a small roof!")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)